'use strict'


const path = require ('path')
const devEnv = require ('./dev.env')

module.exports = {
  dev: {

    // Paths
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    // 代理列表, 是否开启代理通过[./dev.env.js]配置
    proxyTable: devEnv.OPEN_PROXY === false ? {} : {
      '': {
        target: `http://172.16.10.24:8898`,
        changeOrigin: true
      },
      disableHostCheck: true
    },


    host: 'localhost',
    port: 8001,
    autoOpenBrowser: true,
    errorOverlay: true,
    notifyOnErrors: true,
    poll: false,


    useEslint: true,

    showEslintErrorsInOverlay: false,

    /**
     * Source Maps
     */


    devtool: 'eval-source-map',


    cacheBusting: true,


    cssSourceMap: false
  },

  build: {
    // Template for index.html
    index: path.resolve (__dirname, '../dist/index.html'),

    // Paths
    assetsRoot: path.resolve (__dirname, '../dist'),
    assetsSubDirectory: 'static',
    assetsPublicPath: './',

    /**
     * Source Maps
     */

    productionSourceMap: false,

    devtool: '#source-map',


    productionGzip: false,
    productionGzipExtensions: ['js', 'css'],

    bundleAnalyzerReport: process.env.npm_config_report
  }
}
